 //#define BLINKER_WIFI
//#include <ArduinoJson.h>
//#include <Blinker.h>

#include "display.h"
#include "lv_port_indev.h"

#include "imu.h"
#include "network.h"
#include "common.h"
#include "app/weather/weather.h"
#include "app/bilibili_fans/bilibili.h"
#include "app/sys/app_contorller.h"
#include "app/picture/picture.h"

Display screen;
IMU mpu;
// Network networ;  
AppController *app_contorller;
Imu_Action *act_info;   





//char auth[] = "78a9d46bc0f1";
// char ssid[] = "@PHICOMM_5B";
// char pswd[] = "f13828704732";


//String  key = "Sd8al_0pDThjCwtJG"; //




void setup(){ 
   
    Serial.begin(115200);
   
    
    mpu.init();
    screen.init();
    //screen.setBackLight(1.0);  
    lv_port_indev_init();
    app_contorller = new AppController(); 
    app_contorller->app_register(&weather_app);
    app_contorller->app_register(&bilibili_app);
    app_contorller->app_register(&picture_app);
    g_network.init();
    
    
    
    
    Serial.println(g_network.getBilibiliFans("http://api.bilibili.com/x/relation/stat?vmid=20259914"));
     
  
    act_info = mpu.update(200);
    
} 

      






void loop()
{
   screen.routine();
    
    app_contorller->main_process(act_info); 
    act_info = mpu.update(200);
   
  


  g_network.getwifi();
     
}
      



        

        





    


 




 
